// NoiseDlg.cpp : implementation file
//

#include "stdafx.h"
#include "test.h"
#include "NoiseDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CNoiseDlg dialog


CNoiseDlg::CNoiseDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CNoiseDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CNoiseDlg)
	m_res = 64;
	m_offset = 0.0f;
	m_octavas = 0;
	m_lacunarity = 0.0f;
	m_h = 0.0f;
	m_distortion = 0.0f;
	m_gain = 0.0f;
	//}}AFX_DATA_INIT
}


void CNoiseDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CNoiseDlg)
	DDX_Text(pDX, IDC_RESOLUTION, m_res);
	DDV_MinMaxInt(pDX, m_res, 16, 256);
	DDX_Text(pDX, IDC_OFFSET, m_offset);
	DDX_Text(pDX, IDC_OCTAVES, m_octavas);
	DDV_MinMaxInt(pDX, m_octavas, 1, 20);
	DDX_Text(pDX, IDC_LACUNARITY, m_lacunarity);
	DDX_Text(pDX, IDC_H, m_h);
	DDX_Text(pDX, IDC_DISTORTION, m_distortion);
	DDX_Text(pDX, IDC_GAIN, m_gain);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CNoiseDlg, CDialog)
	//{{AFX_MSG_MAP(CNoiseDlg)
	ON_BN_CLICKED(IDC_APLICAR_MULTIFRACTAL, OnAplicarMultifractal)
	ON_BN_CLICKED(IDC_APLICAR_RIDGED, OnAplicarRidged)
	ON_BN_CLICKED(IDC_APLICAR_HYBRID, OnAplicarHybrid)
	ON_BN_CLICKED(IDC_APLICAR_TERRENO, OnAplicarTerreno)
	ON_BN_CLICKED(IDC_APLICAR_PERLIN, OnAplicarPerlin)
	ON_BN_CLICKED(IDC_APLICAR_SIMPLE, OnAplicarSimple)
	ON_BN_CLICKED(IDC_ROAM, OnRoam)
	ON_BN_CLICKED(IDC_HMAP, OnHmap)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CNoiseDlg message handlers

BOOL CNoiseDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CNoiseDlg::OnAplicarMultifractal() 
{
	tipo=MULTI;
	
}

void CNoiseDlg::OnAplicarRidged() 
{
	tipo=RIDGED;
	
}

void CNoiseDlg::OnAplicarHybrid() 
{
	tipo=HIBRIDO;
	
}

void CNoiseDlg::OnAplicarTerreno() 
{
	tipo=TERRENO;

	
}

void CNoiseDlg::OnAplicarPerlin() 
{
	tipo=PERLIN;
	
}

void CNoiseDlg::OnAplicarSimple() 
{
	tipo=SIMPLE;
	
}

void CNoiseDlg::OnRoam() 
{
	roam=1;
	CDialog::OnOK();	
}

void CNoiseDlg::OnHmap() 
{
	roam=0;
	CDialog::OnOK();
	
}
